********************************************************************************
* Analyses of Reservation Withdrawals for "Social Pressure in the International Human Rights Regime"
* Authors: Christina Boyes, Cody D. Eldredge, Megan Shannon, and Kelebogile Zvobgo
* Date: May 2023
* Dataset: Replication_Boyesetal.dta
* Description: Replication code for analyses in the main text and supplemental information
********************************************************************************

*** Part 1 of this code replicates results presented in the primary manuscript, while Part 2 replicates results presented in the supplementary materials. 

** Part 1 ** 

// Table 3, Model 1

heckprobit withdrawal objections, sel(reservation= i.legalsys demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total) 

// Marginal Effects, Figure 1
margins, at(objections =(0(1)25))
marginsplot, addplot(hist objections if objections>0, frequency yaxis(2) yscale(alt axis(2)))

// Table 3, Model 2

heckprobit withdrawal reviewyearwithdraw, sel(reservation= i.legalsys demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total) 

// Table 3, Model 3 

heckprobit withdrawal objections reviewyearwithdraw, sel(reservation= i.legalsys demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total) 

// Table 3, Model 4 

heckprobit withdrawal objections reviewyearwithdraw avg_polity2 avg_nhri_powers demanding nonderog_prov, sel(reservation= i.legalsys demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total) 

// Marginal Effects, Figure 2 
margins, at(objections =(0(1)25))
marginsplot, addplot(hist objections if objections>0, frequency yaxis(2) yscale(alt axis(2)))

// Table 3, Model 5

heckprobit withdrawal objections reviewyearwithdraw avg_polity2 avg_nhri_powers demanding nonderog_prov avg_v2juhcind treateq_sup avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total, sel(reservation= i.legalsys demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total) 


** Part 2 ** 

// Table 2, Model 1

heckprobit withdrawal objections reviewyearwithdraw avg_polity2 avg_nhri_powers demanding nonderog_prov avg_v2juhcind treateq_sup avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total, sel(reservation= i.legalsys demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total) robust 

// Table 2, Model 2 

heckprobit withdrawal objections reviewyearwithdraw avg_polity2 avg_nhri_powers demanding nonderog_prov avg_v2juhcind treateq_sup avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total, sel(reservation= i.legalsys demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total) robust cluster(cow_id)

// Table 2, Model 3 

heckprobit withdrawal objections reviewyearwithdraw avg_polity2 avg_nhri_powers demanding nonderog_prov avg_v2juhcind treateq_sup avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total, sel(reservation= i.legalsys demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total) robust cluster(treaty_id)

// Table 3, Model 1 

logit withdrawal objections reviewyearwithdraw demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total i.treaty_id if reservation==1, robust 

// Table 3, Model 2 

logit withdrawal objections reviewyearwithdraw demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total if reservation==1, cluster(cow_id)

// Table 3, Model 3 

logit withdrawal objections reviewyearwithdraw demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total if reservation==1, cluster(treaty_id)

// Table 4, Model 1

reg withdrawal objections reviewyearwithdraw demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total i.treaty_id if reservation==1, robust 

// Table 4, Model 2 

reg withdrawal objections reviewyearwithdraw demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total if reservation==1, cluster(cow_id)

// Table 4, Model 3

reg withdrawal objections reviewyearwithdraw demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total if reservation==1, cluster(treaty_id)

// Table 5, Model 1 

logit withdrawal objections reviewyearwithdraw demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total reservation i.treaty_id, robust 

// Table 5, Model 2

logit withdrawal objections reviewyearwithdraw demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total reservation i.cow_id, robust 

// Table 5, Model 3

logit withdrawal objections reviewyearwithdraw demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total reservation , robust cluster(treaty_id)

// Table 5, Model 4

logit withdrawal objections reviewyearwithdraw demanding nonderog_prov avg_v2juhcind treateq_sup avg_nhri_powers avg_polity2 avg_fariss_latentmean avg_ln_gdp_percap avg_ln_pop_total reservation , robust cluster(cow_id)
